<template>
       <!-- 无子集, -->
       <el-menu-item :index="item.url" v-if="item.child.length == 0">
        <span slot="title" >{{item.name}}</span>
      </el-menu-item>
      <!-- 有子集 -->
      <el-submenu :index="path" v-else>
        <template slot="title">
          <span>{{item.name}}</span>
        </template>
        <NavItem v-for="(child,i) in item.child" :key="i" :item="child"/> 
      </el-submenu>
</template>
<script>
export default{
  name: 'NavItem',
  data(){
    return{
    }
  },
  props:['item','path'] //父传子

}

</script>

<style>
.test > li{
  color: #fff;
}
</style>
